/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package src.util;

import javax.servlet.ServletContextEvent;
import src.HibernateUtil;

/**
 *
 * @author jasuke
 */
public class HibernateListener {
    public void contextInitialized(ServletContextEvent event) {
        HibernateUtil.getSessionFactory(); // Just call the static initializer of that class    
    }
 
    public void contextDestroyed(ServletContextEvent event) {
        HibernateUtil.getSessionFactory().close(); // Free all resources
    }
}
